package main

import "fmt"

func produce(out chan<- int)  {
	for i:=0; i < 10; i++ {
		out <- i
	}
	close(out)
}

func consumer(in <-chan int)  {
	for num := range in {
		fmt.Println("num ", num)
	}

}

func main() {
	ch := make(chan int)
	go produce(ch)
	consumer(ch)

}